import React,{FC, useState} from "react"
import "../utils/font_1hsfvuvglv9/iconfont.css"
import classnames from "classnames"
import { useEffect } from "react";
const Theme:React.FC=()=>{
    const [theme,setTheme]=useState("sun");
     
    useEffect(()=>{
       if(theme==='sun'){
           document.body.className='' 
       }else{
           document.body.className="dark"
       }
    },[theme])

    return <span className={classnames('iconfont',theme==='sun'?'icon-taiyang':'icon-yueliang')}
    onClick={()=>setTheme(theme==='sun'?'moon':'sun')}
    ></span>
}
export default Theme;